package com.neulogistics.contrib.usercenter.api.application.command;

import com.blackto.lib.mediat.unicast.IRequest;
import com.neulogistics.infrastructure.common.serviceresult.BaseResponse;
import lombok.Data;


import javax.validation.constraints.*;
import java.io.Serializable;

@Data
public class UpdateUserCommand implements IRequest<BaseResponse<Boolean>>, Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @NotNull(message = "id不能为空！")
    @Positive(message = "非法的id！")
    public Integer userId;
    /**
     * 用户性别
     */
    @Min(value = 0, message = "用户性别取值范围为0-1！")
    @Max(value = 1, message = "用户性别取值范围为0-1！")
    public Integer userGender;

    /**
     * 身份证号
     */
    @NotBlank(message = "身份证号不能为空！")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$",
            message = "错误的身份证号！")
    public String userIdentity;

    /**
     * 用户电话
     */
    @NotBlank(message = "用户电话号不能为空！")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "错误的手机号！")
    public String userPhone;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空！")
    public String name;

    /**
     * 头像
     */
    public String userAvatar;

}
